<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
</head>
<body>

<button id="send">send</button><br/>
<textarea rows="10" cols="40" id="content"></textarea>
<script type="text/javascript">
    var ws=new WebSocket("ws://zha-ita077-w7:8080/spring-merchant/ws/merchant");
    ws.onmessage=function(event){
        var t=document.createTextNode(event.data);
        console.log(event.data);
        document.getElementById("content").appendChild(t);
    }
    var sendBtn=document.getElementById("send");
    sendBtn.onclick=function(){
        ws.send("I am john");
    }
</script>
</body>
</html>